// 获取当前月有多少天
function getMonthOfDay () {
  const date = new Date()
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const monthOfDay = new Date(year, month, 0).getDate()
  return monthOfDay
}

console.log(getMonthOfDay())
